package pta;

import java.util.Scanner;

/**
 * @author tmh
 * @date 2024/12/18 19:54
 * @description
 */
public class T6_17父子年龄比较 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int y, m, d;
        y = sc.nextInt();
        m = sc.nextInt();
        d = sc.nextInt();
        sc.close();
        Age father = new Age(1980);
        father.setMonth(2);
        father.setDay(18);
        Age son = new Age(y, m, d);
        try {
            System.out.print(father.Compare(son));
        } catch (AgeException e) {
            System.out.println(e.toString());
        }
    }
}

class Age {
    int y, m, d;

    public Age(int y) {
        this.y = y;
    }

    public Age(int y, int m, int d) {
        this.y = y;
        this.m = m;
        this.d = d;
    }

    public void setMonth(int m) {
        this.m = m;
    }

    public void setDay(int d) {
        this.d = d;
    }

    public int Compare(Age son) throws AgeException {
        int deference = Math.abs(this.y - son.y);
        //比较月是否相同
        if (m == son.m) {
            //比较天是否相同
            if (d > son.d) {
                deference--;
            }
        } else {
            if (m > son.m) {
                deference--;
            }
        }
        if (deference < 20) {
            throw new AgeException("too young");
        }
        if (deference > 70) {
            throw new AgeException("too old");
        }
        return deference;
    }
}

class AgeException extends Exception {
    public AgeException(String message) {
        super(message);
    }

    public String toString() {
        return getMessage();
    }
}